package package01;

import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class my_download {

	public static void parserDown(String urlStr) throws IOException {
		long size = 0;
		String realURL="";
		String path = "D://1.mp4";
		final long filesize;
		URL url = new URL(urlStr);
		HttpURLConnection con = (HttpURLConnection) url.openConnection();
		size = con.getContentLength();
		realURL = con.getURL().toString();
		
		File f = new File(path);
		if (f.exists()) {
			filesize = f.length();
		} else {
			filesize = 0;
		}
		
		System.out.println("文件大小："+size); 
		System.out.println("真实URL："+realURL); 
		
		

	}

	public static void main(String[] args) throws IOException {

		parserDown("http://v2.mukewang.com/1e93c814-bce5-4bfe-91c4-faaf3163f57f/L.mp4?auth_key=1472039029-0-0-259f5b2291b32542ca9e107b2aed3f90");

	}

}
